package com.lipeng.utils;

import java.sql.Date;
import java.text.SimpleDateFormat;

/**
 * Created by dllo on 18/3/12.
 */
public class TimeUtils {
    public static String time(){
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = sdf.format(date);
        return time;
    }

    public static String date(){
        Date date = new Date(System.currentTimeMillis());
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String time = sdf.format(date);
        return time;
    }

    public static String catBirthday(String str){
        String near = str.substring(6,10);
        String month = str.substring(10, 12);
        String day = str.substring(12,14);
        String birthday = near+"-"+month+"-"+day;
        return birthday;
    }
}
